package org.seed.quantum.protocol;

import org.seed.quantum.socket.AbstractSocketSession;
import org.seed.quantum.socket.Protocol;
import java.nio.ByteBuffer;

public class IntegerProtocol implements Protocol<Integer> {

    @Override
    public Integer decode(ByteBuffer data, AbstractSocketSession session) {
        if (data.remaining() < Integer.BYTES)
            return null;
        return data.getInt();
    }
}
